package com;
/*
 * @Author 罗俊
 * @date 2020/11/30 - 8:56 下午
 *
 */

import com.feign.ProductApi;
import com.vo.ReqSkuVo;
import feign.Feign;
import org.junit.jupiter.api.Test;

import java.util.HashMap;
import java.util.Map;

public class test {


    @Test
    void test(){
        ProductApi productApi = Feign.builder().target(ProductApi.class, "http://localhost:10000");

        Map<String, Object> map = new HashMap<String, Object>();

        map.put("Content-Type","application/json");

        map.put("charset","UTF-8");

        Map<String, Object> queryMap = new HashMap<>();

        String spuInfoByMap = productApi.getSpuInfoByMap(/*queryMap,*/map,1,10);

        System.out.println(spuInfoByMap);
    }


    @Test
    void testByQueryMap(){
        ProductApi productApi = Feign.builder().target(ProductApi.class, "http://localhost:10000");

        ReqSkuVo reqSkuVo = new ReqSkuVo();

        reqSkuVo.setSkuId(7L);

        String spuInfoByPojo = productApi.getSpuInfoByPojo(reqSkuVo,1,10);

        System.out.println(spuInfoByPojo);
    }
}
